﻿using Microsoft.EntityFrameworkCore;
using 订单处理系统.Entity;
using 订单处理系统.Model;

namespace 订单处理系统.Repository
{
    public class StockLogRepository
    {
        private OrderDbContext OrderDbContext { get; set; }

        public StockLogRepository(OrderDbContext orderDbContext)
        {
            OrderDbContext = orderDbContext;
        }

        public async Task Add(StockLog stockLog)
        {
            await OrderDbContext.AddAsync(stockLog);
            await OrderDbContext.SaveChangesAsync();
            return;
        }

        public async Task<List<StockLog>> List()
        {
            return await OrderDbContext.Stocks.ToListAsync();
        }
    }
}